package iD220711010131;

public class HuangJiaLe06 {
    public static void main(String[]args) {
        String str1 = "fsd54d1f6d15sd4f6sd5f4d1s6fd14ds16f54d1";
        String str2 = "d1";
        int count = 0;
        while(str1.contains(str2)) {
            int index = str1.indexOf(str2);
            str1 = str1.substring(index + str2.length());
            count++;
        }System.out.println("出现次数：" + count);
    }

}
